<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//version
define('CONFIG_RELEASE_VERSION', '1.0.0.0');
define('CONFIG_RELEASE_DATE', 'June 16, 2007');
//db
define('CONFIG_DB_TYPE', 'mysql');
define('CONFIG_DB_HOST', 'localhost');
define('CONFIG_DB_USER', 'szsyoc');
define('CONFIG_DB_PASSWORD', 'szsyoc');
define('CONFIG_DB_NAME', 'projects_work_mycms');
define('CONFIG_DB_PREFIX', 'pp_');
define('CONFIG_DB_PCONNECT', 'false');
define('CONFIG_DB_TRANSACTION', 'false');
define('CONFIG_DB_UTF8', 'false');
define('CONFIG_DB_LOGSQL', 'false');
define('CONFIG_DB_LOGFILE', '');
//
define('CONFIG_PATH', dirname(dirname(__FILE__)) . '/');
define('CONFIG_DIR_CACHE', 'var/cache/');
define('CONFIG_DIR_EDITOR', 'editor/');
define('CONFIG_DIR_IMAGES', 'images/');

define('CONFIG_DIR_BRANDS_IMAGES', 'images/brands/');
define('CONFIG_DIR_PRODUCTS_IMAGES', 'images/products/');
define('CONFIG_DIR_PRODUCTS_ORIGINIMAGES', 'images/products/origins/');
define('CONFIG_DIR_PRODUCTS_THUMBIMAGES', 'images/products/thumbs/');
define('CONFIG_DIR_PRODUCTS_RESIZEIMAGES', 'images/products/resized/');
define('CONFIG_DIR_PRODUCTS_CATEGORIES_IMAGES', 'images/categories/');
define('CONFIG_DIR_CATEGORIES_IMAGES', 'images/categories/');

define('CONFIG_DIR_RESOURCES', 'images/resources/');
define('CONFIG_DIR_RESOURCES_THUMBIMAGES', 'images/resources/thumbs/');
define('CONFIG_DIR_ALBUMS_IMAGES', 'images/albums/');
define('CONFIG_DIR_ALBUMS_ORIGINIMAGES', 'images/albums/origins/');
define('CONFIG_DIR_ALBUMS_THUMBIMAGES', 'images/albums/thumbs/');
define('CONFIG_DIR_ALBUMS_RESIZEIMAGES', 'images/albums/resized/');
define('CONFIG_DIR_COMPANY_IMAGES', 'images/company/');
define('CONFIG_DIR_COMPANY_ORIGINIMAGES', 'images/company/origins/');
define('CONFIG_DIR_COMPANY_THUMBIMAGES', 'images/company/thumbs/');
define('CONFIG_DIR_COMPANY_RESIZEIMAGES', 'images/company/resized/');
define('CONFIG_DIR_GROUPS_IMAGES', 'images/groups/');

define('CONFIG_DIR_USERS_IMAGES', 'images/users/');
define('CONFIG_DIR_USERS_ORIGINIMAGES', 'images/users/origins/');
define('CONFIG_DIR_USERS_THUMBIMAGES', 'images/users/thumbs/');
define('CONFIG_DIR_USERS_RESIZEIMAGES', 'images/users/resized/');

define('CONFIG_DIR_UPLOADS', 'images/uploads/');
define('CONFIG_DIR_UPLOADS_ORIGINS', 'images/uploads/origins/');
define('CONFIG_DIR_UPLOADS_THUMBS', 'images/uploads/thumbs/');
define('CONFIG_DIR_UPLOADS_RESIZED', 'images/uploads/resized/');

define('CONFIG_DIR_INCLUDES', 'includes/');
define('CONFIG_DIR_FRONTS', 'includes/fronts/');
define('CONFIG_DIR_FUNCTIONS', 'includes/functions/');
define('CONFIG_DIR_CLASSES', 'includes/classes/');
define('CONFIG_DIR_CLASSES_VALIDATE', 'includes/classes/validate/');
define('CONFIG_DIR_CRONS', 'includes/crons/');
define('CONFIG_DIR_UTILS', 'includes/utils/');
define('CONFIG_DIR_APPS', 'includes/apps/');
define('CONFIG_DIR_MODULES', 'includes/modules/');

define('CONFIG_DIR_LIB', 'lib/');
define('CONFIG_DIR_JPGRAPH_PATH', 'lib/jpgraph/');
define('CONFIG_DIR_METADATA', 'metadata/');
define('CONFIG_DIR_SETTINGS', 'settings/');
define('CONFIG_DIR_LANGUAGES', 'languages/');
define('CONFIG_DIR_JS', 'js/');
define('CONFIG_DIR_STYLES', 'styles/');
define('CONFIG_DIR_TEMPLATES', 'templates/');
//
define('CONFIG_THEME', 'default');
define('CONFIG_STYLE', 'default');
//
define('CONFIG_URL_DIRN', dirname($_SERVER['SCRIPT_NAME']));
define('CONFIG_URL_PREFIX', CONFIG_URL_DIRN . '/');
define('CONFIG_URL_SUFFIX', '.html');
//
define('CONFIG_PROTOCOL_HTTP', 'http://');
define('CONFIG_PROTOCOL_HTTPS', 'https://');
define('CONFIG_URL_DOMAIN', $_SERVER['HTTP_HOST']);
//define('CONFIG_URL_PATH', CONFIG_URL_DIRN . '/');
if( CONFIG_URL_DIRN == '/' || CONFIG_URL_DIRN == '\\' ) {
	define('CONFIG_URL_PATH', '/');
	define('CONFIG_URL', CONFIG_URL_DOMAIN . CONFIG_URL_PATH);
	define('CONFIG_URL_HTTP', CONFIG_PROTOCOL_HTTP . CONFIG_URL);
	define('CONFIG_URL_HTTPS', CONFIG_PROTOCOL_HTTPS . CONFIG_URL);
	define('CONFIG_COOKIE_DOMAIN_HTTP', $_SERVER['SERVER_NAME']);
	define('CONFIG_COOKIE_PATH_HTTP', '/');
	define('CONFIG_COOKIE_DOMAIN_HTTPS', $_SERVER['HTTP_HOST']);
	define('CONFIG_COOKIE_PATH_HTTPS', '/');
} else {
	define('CONFIG_URL_PATH', CONFIG_URL_DIRN . '/');
	define('CONFIG_URL', CONFIG_URL_DOMAIN . CONFIG_URL_PATH);
	define('CONFIG_URL_HTTP', CONFIG_PROTOCOL_HTTP . CONFIG_URL);
	define('CONFIG_URL_HTTPS', CONFIG_PROTOCOL_HTTPS . CONFIG_URL);
	define('CONFIG_COOKIE_DOMAIN_HTTP', $_SERVER['SERVER_NAME']);
	define('CONFIG_COOKIE_PATH_HTTP', CONFIG_URL_DIRN . '/');
	define('CONFIG_COOKIE_DOMAIN_HTTPS', $_SERVER['HTTP_HOST']);
	define('CONFIG_COOKIE_PATH_HTTPS', CONFIG_URL_DIRN . '/');
}
//
define('CONFIG_SESSION_WRITE_DIRECTORY', CONFIG_PATH . 'var/session/');
define('CONFIG_SESSION_FORCE_COOKIE_USE', 'True');
define('CONFIG_SESSION_BLOCK_SPIDERS', 'False');
//
define('CONFIG_URL_DIRECTORY', false);
define('CONFIG_ENABLE_SSL', false);
define('CONFIG_DEBUG', false);
define('CONFIG_LOCALE', 'en_US');
define('CONFIG_OFFSET', '0');
define('CONFIG_SECRET', '$$FBVtggIk5lAzEU9H$$');
define('CONFIG_ALLOW_USER_REGISTERATION', '1');
//
define('CONFIG_COMPANY_NAME', 'COMPANY');
define('CONFIG_METADESC', '');
define('CONFIG_METAKEYS', '');
define('CONFIG_METATITLE', '1');
define('CONFIG_METAAUTHOR', '1');
define('CONFIG_LIST_LENGTH', '10');
define('CONFIG_NAVIGATION', '1');
//
define('CONFIG_HIDE_AUTHOR', '0');
define('CONFIG_HIDE_CREATEDATE', '0');
define('CONFIG_HIDE_MODIFYDATE', '0');
define('CONFIG_HIDE_PDF', '0');
define('CONFIG_HIDE_PRINT', '0');
define('CONFIG_HIDE_EMAIL', '0');
define('CONFIG_HIDE_READMORE', '0');
define('CONFIG_HIDE_HITS', '0');
define('CONFIG_HIDE_ICONS', '0');
//
define('CONFIG_ENABLE_LOG_ITEMS', '0');
define('CONFIG_ENABLE_LOG_SEARCHES', '0');
define('CONFIG_ENABLE_STATS', '1');
define('CONFIG_ENABLE_SEF', '0');
define('CONFIG_ENABLE_VOTE', '0');
define('CONFIG_ENABLE_GZIP', '0');
define('CONFIG_ENABLE_MULTIPAGE', '0');
//
define('CONFIG_ERROR_REPORTING', '-1');
define('CONFIG_ERROR_MESSAGE', '');
//
define('CONFIG_CACHING', '0');
define('CONFIG_CACHE_PATH', '0');
define('CONFIG_CACHE_TIME', '0');
//
define('CONFIG_MAILER', 'mail');
define('CONFIG_MAIL_FROM', '');
define('CONFIG_MAIL_FROMNAME', '');
define('CONFIG_MAIL_SENDMAIL', '');
define('CONFIG_MAIL_SMTP_AUTH', '0');
define('CONFIG_MAIL_SMTP_USER', '0');
define('CONFIG_MAIL_SMTP_PASS', '0');
define('CONFIG_MAIL_SMTP_HOST', 'localhost');
//
define('CONFIG_EMAIL_USE_HTML', 'true');
define('CONFIG_EMAIL_CHARSET', 'UTF-8');
define('CONFIG_EMAIL_ADDRESS', '');
define('CONFIG_EMAIL_TRANSPORT', '');
define('CONFIG_EMAIL_LINEFEED', '');
//
define('CONFIG_PERM_FILE', '');
define('CONFIG_PERM_DIR', '');

//
@ini_set('memory_limit',			'128M');
@ini_set('display_errors',			1);
@ini_set('magic_quotes_runtime',	0);

//SYS_RT_REQUEST_URI
//define('SYS_RT_REQUEST_URI', substr($_SERVER['REQUEST_URI'], strlen(CONFIG_URL_PATH)));
$_request_uri = substr($_SERVER['REQUEST_URI'], strlen(CONFIG_URL_PATH));
define('SYS_RT_REQUEST_URI_', $_request_uri);
//
/*
if( substr($_request_uri, 0, 10) == 'intl/zh-TW' ) {
	$lang = 'zh_tw';
	$_lang_uri = substr($_request_uri, 0, 10) . '/';
	$_request_uri = substr($_request_uri, 11);
} elseif( substr($_request_uri, 0, 10) == 'intl/zh-CN' ) {
	$lang = 'zh_cn';
	$_lang_uri = substr($_request_uri, 0, 10) . '/';
	$_request_uri = substr($_request_uri, 11);
} elseif( substr($_request_uri, 0, 10) == 'intl/en-US' ) {
	$lang = 'en_us';
	$_lang_uri = substr($_request_uri, 0, 10) . '/';
	$_request_uri = substr($_request_uri, 11);
} else {
	$lang = 'en_us';
	$_lang_uri = '';
}*/
//
$lang = 'en_us';
$_lang_uri = '';
if( isset($CONFIG['language']) && is_array($CONFIG['language']) ) {
	foreach($CONFIG['language'] as $k => $v) {
		if( substr($_request_uri, 0, strlen($v['uri'])) == $v['uri'] ) {
			$lang = $v['lang'];
			$_lang_uri = $v['uri'] . '/';
			$_request_uri = substr($_request_uri, strlen($v['uri'])+1);
		}
	}
}
//
define('SYS_RT_LANG', $lang);
define('SYS_RT_LANG_URI', $_lang_uri);
define('SYS_RT_REQUEST_URI', $_request_uri);
define('IS_AJAX', (!empty($_SERVER['HTTP_AJAX_REQUEST'])) || (!empty($_REQUEST['ajax'])));
define('SYS_RT_URL_JS', CONFIG_URL_HTTP . 'js/');
//
?>